package TestDemo1;

public class Computer {
    private String cpu;
    private String memory;
    String brand;
    protected int useYear;
    public static int num;
}

class Animal{
    int age;
    String name;
    public void eat(){
        System.out.println(this.name + "吃饭");
    }
    Animal(){
        System.out.println("wuhu qifei");
    }
    static {
        System.out.println("fa sheng shen me shi le");
    }
    {
        System.out.println("haha");
    }
}

class Dog extends Animal{
    @Override
    public void eat() {
        System.out.println(this.name + "吃狗粮");
    }
    static {
        System.out.println("zhe bo shi rou dan chong ji");
    }
}

class T{
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "wuhu";
        dog.eat();
        Dog dog2 = new Dog();
        /*Animal animal = new Dog();
        animal.name = "qifei";
        animal.eat();*/
    }
    public static void main1(String[] args) {
        Computer computer1 = new Computer();
        Computer computer2 = new Computer();
        Computer.num++;
        System.out.println(computer2.num);
    }
}
